import { createStore } from 'vuex'
import type { Component } from 'vue'
import { 
  Lock, 
  Switch, 
  Document, 
  Picture, 
  Files, 
  VideoPlay, 
  Headset,
  DataAnalysis,
  Connection,
  Monitor
} from '@element-plus/icons-vue'

// 定义工具类型
export interface Tool {
  id: number
  name: string
  description: string
  icon: string
  path: string
}

// 定义 State 类型
export interface State {
  tools: Tool[]
}

// 图标映射对象
export const iconComponents: Record<string, Component> = {
  Lock,
  Switch,
  Document,
  Picture,
  Files,
  VideoPlay,
  Headset,
  DataAnalysis,
  Connection,
  Monitor
}

export default createStore<State>({
  state: {
    tools: [
      {
        id: 1,
        name: '文本处理',
        description: '文本格式化、加密解密、Markdown转换等',
        icon: 'Document',
        path: '/text'
      },
      {
        id: 2,
        name: '格式转换',
        description: 'JSON、XML、HTML格式化，CSV转换等',
        icon: 'Switch',
        path: '/format'
      },
      {
        id: 3,
        name: '加密工具',
        description: 'MD5、SHA、AES等加密解密',
        icon: 'Lock',
        path: '/encryption'
      },
      {
        id: 4,
        name: '图片处理',
        description: '图片压缩、格式转换、水印添加等',
        icon: 'Picture',
        path: '/image'
      },
      {
        id: 5,
        name: '文件处理',
        description: '文件格式转换、压缩解压、批量重命名等',
        icon: 'Files',
        path: '/file'
      },
      {
        id: 6,
        name: '视频处理',
        description: '视频格式转换、压缩、剪辑等',
        icon: 'VideoPlay',
        path: '/video'
      },
      {
        id: 7,
        name: '音频处理',
        description: '音频格式转换、剪辑、音量调节等',
        icon: 'Headset',
        path: '/audio'
      },
      {
        id: 8,
        name: '数据分析',
        description: '数据可视化、统计分析、图表生成等',
        icon: 'DataAnalysis',
        path: '/data'
      },
      {
        id: 9,
        name: '网络工具',
        description: 'IP查询、端口扫描、网络诊断等',
        icon: 'Connection',
        path: '/network'
      },
      {
        id: 10,
        name: '开发工具',
        description: '代码格式化、正则测试、API调试等',
        icon: 'Monitor',
        path: '/dev'
      }
    ]
  },
  mutations: {
  },
  actions: {
  },
  modules: {
  }
}) 